package com.lh.leetCode;

import java.util.HashMap;
import java.util.Map;

public class Test01 {
    public static void main(String[] args) {
        Test01 test01 = new Test01();

    }


    public boolean isUnique(String astr) {

        Map<Character, Integer> map = new HashMap<>();

        for (int i = 0; i < astr.length(); i++) {

            if (map.containsKey(astr.charAt(i))) {
                map.put(astr.charAt(i), map.get(astr.charAt(i) + 1));
                return false;
            } else {
                map.put(astr.charAt(i), 1);
            }
        }
        return true;
    }


}
